package de.ff7rl.ui;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import de.ff7rl.core.Game;
import de.ff7rl.core.gamestate.GameStateController;

public class UserInterfaceKeyListener implements KeyListener {

  private final Game game;

  public UserInterfaceKeyListener(final Game theGame) {
    game = theGame;
  }

  @Override
  public void keyPressed(final KeyEvent theEvent) {
    final GameStateController gameState = game.getGameStateController();
    gameState.input(theEvent.getKeyCode());
  }

  @Override
  public void keyReleased(final KeyEvent theEvent) {
  }

  @Override
  public void keyTyped(final KeyEvent theEvent) {
  }

}
